-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
167: Remove dependency on Terraform Cloud and cas-shelf #168
Conversation
[ | ||
"/bin/sh", | ||
"-c", | ||
"cp -r /terraform/. /working && cd working && export TF_VAR_kubernetes_token=$( cat /var/run/secrets/kubernetes.io/serviceaccount/token ) && terraform init -backend-config=/etc/tf/gcs.tfbackend && terraform apply -var=\"kubernetes_host=$kubernetes_host\" -auto-approve", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command seems good, can we just copy the format over from https://github.com/bcgov/cas-ggircs/pull/541/files#diff-a9ba9b54159fd14a6b9bda6d1aa6c143b729b38bea4360715ddd483c70ec3b52R50 to break it up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the formatting request this looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Github - Project link
Adds Terraform scripts and Helm charts to run them. Resource states migrated from Terraform Cloud to a Google Cloud Storage bucket.
Changes 🚧
Added Terraform module, imported from cas-shelf
Added Helm templates to handle:
Terraform module loading to configMaps
OpenShift service account for use by Terraform
Terraform apply job
To test 🔬
The Helm charts are built into the automation around deploys via ShipIt. Once a deploy has been run, you can check the job Terraform-apply in OpenShift to see if the run was successful.
Notes📝
🔒 Terraform Cloud state has been locked to enable migration of state to state buckets
The script has been run and resources have been transitioned from Terraform Cloud to GCP buckets holding state for each namespace (airflow-dev, airflow-test, airflow-prod).
Resources have been migrated rather than recreated, only the state "owning" the resource changes.
The resources kubernetes_secret.secret_sa have had Terraform changes, but only the addition of a default value (consistent with our use of them) due to a new provider version.
The script used for migration (/chart/cas-airflow/terraform/tf-migration.sh) is kept here for history. It will be removed by bcgov/cas-pipeline#83